<div class="modal" ng-controller="FlowableFieldsPopupCtrl">
  <div class="modal-dialog modal-wide">
    <div class="modal-content">
      <div class="modal-header">
        <button aria-hidden="true" class="close" data-dismiss="modal" ng-click="close()" type="button">&times;</button>
        <h3>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate}} "{{property.title | translate}}"</h3>
      </div>
      <div class="modal-body">

        <div class="row row-no-gutter">
          <div class="col-xs-6">
            <div class="kis-listener-grid" ng-if="translationsRetrieved" ui-grid="gridOptions" ui-grid-selection></div>
            <div class="pull-right">
              <div class="btn-group">
                <a class="btn btn-icon btn-lg" data-original-title="" data-placement="bottom"
                   data-title="{{'ACTION.MOVE.UP' | translate}}" ng-click="moveFieldUp()" rel="tooltip" title=""><i
                        class="glyphicon glyphicon-arrow-up"></i></a>
                <a class="btn btn-icon btn-lg" data-original-title="" data-placement="bottom"
                   data-title="{{'ACTION.MOVE.DOWN' | translate}}" ng-click="moveFieldDown()" rel="tooltip" title=""><i
                        class="glyphicon glyphicon-arrow-down"></i></a>
              </div>
              <div class="btn-group">
                <a class="btn btn-icon btn-lg" data-original-title="" data-placement="bottom"
                   data-title="{{'ACTION.ADD' | translate}}" ng-click="addNewField()" rel="tooltip" title=""><i
                        class="glyphicon glyphicon-plus"></i></a>
                <a class="btn btn-icon btn-lg" data-original-title="" data-placement="bottom"
                   data-title="{{'ACTION.REMOVE' | translate}}" ng-click="removeField()" rel="tooltip" title=""><i
                        class="glyphicon glyphicon-minus"></i></a>
              </div>
            </div>
          </div>

          <div class="col-xs-6">
            <div ng-show="selectedField">

              <div class="form-group">
                <label translate>PROPERTY.FIELDS.NAME</label>
                <input class="form-control" ng-model="selectedField.name"
                       placeholder="{{'PROPERTY.FIELDS.NAME.PLACEHOLDER' | translate}}"
                       type="text"/>
              </div>
              <div>
                <label translate>PROPERTY.FIELDS.STRINGVALUE</label>
                <input class="form-control" ng-change="fieldDetailsChanged()" ng-model="selectedField.stringValue"
                       placeholder="{{'PROPERTY.FIELDS.STRINGVALUE.PLACEHOLDER' | translate}}"
                       type="text"/>
              </div>
              <div>
                <label translate>PROPERTY.FIELDS.EXPRESSION</label>
                <input class="form-control" ng-change="fieldDetailsChanged()" ng-model="selectedField.expression"
                       placeholder="{{'PROPERTY.FIELDS.EXPRESSION.PLACEHOLDER' | translate}}"
                       type="text"/>
              </div>
              <div>
                <label translate>PROPERTY.FIELDS.STRING</label>
                <textarea class="form-control" ng-change="fieldDetailsChanged()" ng-model="selectedField.string"
                          placeholder="{{'PROPERTY.FIELDS.STRING.PLACEHOLDER' | translate}}"
                          type="text"></textarea>
              </div>

            </div>
            <div class="muted no-property-selected" ng-show="!selectedField" translate>PROPERTY.FIELDS.EMPTY</div>
          </div>
        </div>

      </div>
      <div class="modal-footer">
        <button class="btn btn-primary" ng-click="cancel()" translate>ACTION.CANCEL</button>
        <button class="btn btn-primary" ng-click="save()" translate>ACTION.SAVE</button>
      </div>
    </div>
  </div>
</div>
